package com.awesome.databindingdemo.databinding2.bean;

import androidx.databinding.BindingConversion;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Author: zhangjingfang
 * Email:zhangjingfang@jeejio.com
 * Date: 2021/7/28 10:52 下午
 * Description:类描述
 */
public class Utils {
    public static String getName(Swordsman swordsman){
        return swordsman.getName();
    }

    @BindingConversion
    public static String convertDate(Date date){
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        return sdf.format(date);
    }
} 